package priv.mill.views;
import org.apache.log4j.Logger;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import priv.mill.dao.model.UserT;

@Component
public class UserConvert implements Converter<String, UserT>{

	private static final Logger logger = Logger.getLogger(UserConvert.class);

	@Override
	public UserT convert(String arg0) {
		if(arg0!=null&&arg0.length()>0){
			String[] split = arg0.split("-");
			UserT userT = new UserT();
			userT.setAge(Integer.valueOf(split[1]));
			userT.setUserName(split[0]);
			return userT;
		}
		return null;
	}
}
